package com.changxianggu.cloud.crawler.core.modules.app.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 网络课程章节信息
 * </p>
 *
 * @author hanez
 * @since 2021-01-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("cxg_online_course_item")
public class CxgOnlineCourseItem extends Model<CxgOnlineCourseItem> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 标题
     */
    @TableField("title")
    private String title;

    /**
     * 课程id
     */
    @TableField("course_id")
    private Integer courseId;

    /**
     * 资源播放类型(1:保利威存储2:外链地址;)
     */
    @TableField("video_type")
    private Integer videoType;

    /**
     * 如果视频是存储于保利威,则使用视频的ID播放
     */
    @TableField("polyv_video_id")
    private String polyvVideoId;

    /**
     * 视频地址
     */
    @TableField("video_uri")
    private String videoUri;

    /**
     * 音频地址
     */
    @TableField("audio_uri")
    private String audioUri;

    /**
     * epub格式文档地址
     */
    @TableField("epub_uri")
    private String epubUri;

    /**
     * 父id
     */
    @TableField("pid")
    private Integer pid;

    @TableField("cover")
    private String cover;

    /**
     * 暂时预留每个小节的价格
     */
    @TableField("price")
    private BigDecimal price;

    /**
     * 课程学习持续时长(单位分钟)
     */
    @TableField("duration_time")
    private Integer durationTime;

    /**
     * 视频简短介绍
     */
    @TableField("brief_short")
    private String briefShort;

    /**
     * 添加时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 虚拟人数
     */
    @TableField("virtual_num")
    private Integer virtualNum;

    /**
     * 是否是试听章节(1:是;0:否;)
     */
    @TableField("is_preview")
    private Integer isPreview;

    /**
     * 是否包含子章节
     */
    @TableField("is_include")
    private Integer isInclude;

    /**
     * 创建的用户名
     */
    @TableField("create_user")
    private String createUser;

    /**
     * 状态(1:正常;0:不可用;)
     */
    @TableField("status")
    private Integer status;

    /**
     * 出版社id
     */
    @TableField("press_id")
    private Integer pressId;

    @TableField(exist = false)
    private List<CxgOnlineCourseItem> children;

    @TableField(exist = false)
    private String videoTypeName;

    @TableField(exist = false)
    private String isPreviewName;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    public interface MUST {
    }

    public interface CREATE {
    }

    public interface UPDATE {
    }
}
